/*
 * public class DataHelper
 * author: adam barney
 * Provides some convenient data access methods that don't belong in the Billboard DAO model class.
 */

/*
 * This file is part of WhatItDo.
 *
 * WhatItDo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * WhatItDo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with WhatItDo.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.sourceforge.whatitdo.billboard.model;

import java.util.ArrayList;

public class DataHelper {

    /*
     * Public static method that takes a username and password, and returns true
     * if the supplied credentials are valid, and false if invalid.
     */
    public static boolean isValidLogin(String suppliedUsername,
	    String suppliedPassword) {
	String password = DataService.getPasswordFromUsername(suppliedUsername);
	if (password.equals(suppliedPassword)) {
	    return true;
	} else {
	    return false;
	}
    }

    /*
     * Public static method that returns the billboard.name from the supplied
     * billboard.id.
     */
    public static String getBillboardName(String id) {
	String rtrn = DataService.getName(id);
	return rtrn;
    }
    
    /*
     * I'll want to deprecate this method ASAP.
     */
    public static String getBillboardId(String name) {
	String rtrn = DataService.getBillboardIdFromName(name);
	return rtrn;
    }

    /*
     * Public static method that returns an ArrayList<String> of all billboard
     * ids belonging to the supplied username.
     */
    public static ArrayList<String> getBillboardsForUser(String username) {
	ArrayList<String> rtrn = DataService.getBillboardsForUser(username);
	return rtrn;
    }
    
    /*
     * Public static method that returns an ArrayList<String> of all billboard
     * names (not IDs) belonging to the supplied username.
     */
    public static ArrayList<String> getBillboardNamesForUser(String username) {
	ArrayList<String> rtrn = DataService.getBillboardNamesForUser(username);
	return rtrn;
    }
    
    public static String getPublishedBillboardId() {
	String rtrn = DataService.getPublishedBillboardId();
	return rtrn;
    }

    public static void deleteBillboard(String id) {
	DataService.deleteBillboard(id);
	
    }

}
